def callPowershell(){
    def results = (["powershell.exe","/c","Get-ChildItem D:/X/ -Recurse  | ?{Test-Path \$_.fullname -Type container} | %{\$_.fullname}"].execute().text.readLines())

    for (item in results) {
        println item
    }    
}

callPowershell()

def callCMD(){
    def results = (["cmd.exe","/c","dir D:/X/config"].execute().text.readLines())

    for (item in results) {
        println item
    }    
}